<template>
  <div>
    <p>商品名称：{{ $route.params.name }}</p>
    <router-link to="oppo">oppo</router-link>
  </div>
</template>

<script>
export default {
  created() {
    console.log("我在获取" + this.$route.params.name + "的数据");
  },
  watch: {
    $route(to, from) {
      console.log("我在获取" + to.params.name + "的数据");
    },
  },
  methods: {},
};
</script>

<style>
</style>